package com.example.demo.mapper;

import com.example.demo.entity.Commentsinfo;
import com.example.demo.entity.ReplayCommentsinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;


@Mapper
public interface CommentsMapper {




    //添加评论
    int addComments(Commentsinfo commentsinfo);

    //根据aid获取评论信息
    List<Commentsinfo> getcommentsbyaid(@Param("aid") Integer aid);

    //赞评论
    int addGCount(@Param("id") Integer id);

    //踩评论
    int addBCount(@Param("id") Integer id);

    //根据评论的id，获取评论的回复列表
    List<ReplayCommentsinfo> getReplayCommentsByCid(@Param("cid") Integer cid);

    //根据id删除评论表里面的评论
    int delCommentsById(@Param("id") Integer id);

    //根据评论id找到所属的uid
    int getUidById(@Param("id") Integer id);

    //添加评论的回复
    int addReplayComments(ReplayCommentsinfo replayCommentsinfo);



    //赞二级评论
    int addGCount2(@Param("id") Integer id);

    //踩二级评论
    int addBCount2(@Param("id") Integer id);


    //根据id删除评论回复表replaycomments表里面的回复
    int delCommentsById2(@Param("id") Integer id);

    //根据评论回复id找到所属的uid
    int getUidById2(@Param("id") Integer id);


    int getCidByRid(@Param("rid") int rid);

    //添加评论的回复的回复
    int addReplayComments2(ReplayCommentsinfo replayCommentsinfo);

    int updateCommentsPhoto(Integer uid, String photoPathRe);

    int updateReplayCommentsPhoto(Integer uid, String photoPathRe);
}


